import request from '@/utils/request2'

// 列表
export function hazopList(query) {
  return request({
    url: '/ehs_hazop_analysis/list',
    method: 'get',
    baseURL: process.env.VUE_APP_BASE_API2,
    params: query
  })
}

// 明细列表
export function hazopDetailList(query) {
  return request({
    url: '/ehs_hazop_analysis/listDetail',
    method: 'get',
    baseURL: process.env.VUE_APP_BASE_API2,
    params: query
  })
}

 // 查询总数量
export function fetchAllCount() {
  return request({
    url: '/ehs_hazop_analysis/listcount',
    method: 'get',
    baseURL: process.env.VUE_APP_BASE_API2

  })
}
// 新增保存
export function addHazop(data) {
  return request({
    url: '/ehs_hazop_analysis/add',
    method: 'post',
    baseURL: process.env.VUE_APP_BASE_API2,
    data
  })
}


// 编辑保存
export function editHazop(data) {
  return request({
    url: '/ehs_hazop_analysis/edit',
    method: 'post',
    baseURL: process.env.VUE_APP_BASE_API2,
    data
  })
}

// 删除
export function deleteHazop(id) {
  return request({
    url: '/ehs_hazop_analysis/delete',
    method: 'get',
    baseURL: process.env.VUE_APP_BASE_API2,
    params: { id }
  })
}

// 获取人员列表
export function getPersonList() {
  return request({
    url: '/ehs_hazop_analysis/personlist',
    method: 'get',
    baseURL: process.env.VUE_APP_BASE_API2
  })
}
// 获取部门列表
export function getDeptList() {
  return request({
    url: '/ehs_hazop_analysis/deptlist',
    method: 'get',
    baseURL: process.env.VUE_APP_BASE_API2

  })
}